package ute.mvc.model;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

@Entity
public class TestAndQuizz_Student implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 5531578021198698280L;
	@Id
	@Column(length = 20)
	private String testAndQuizz_StudentId;
	@ManyToOne
	@JoinColumn(name = "testAndQuizzId")
	private TestAndQuizz testAndQuizz;

	@ManyToOne
	@JoinColumn(name = "studentId")
	private User student;
	// Vinh
	@OneToMany(mappedBy = "testAndQuizz_student")
	Set<SubmittedTestAndQuizz> listSubmittedTestAndQuizz = new HashSet<SubmittedTestAndQuizz>();

	public Set<SubmittedTestAndQuizz> getListSubmittedTestAndQuizz() {
		return listSubmittedTestAndQuizz;
	}

	public void setListSubmittedTestAndQuizz(
			Set<SubmittedTestAndQuizz> listSubmittedTestAndQuizz) {
		this.listSubmittedTestAndQuizz = listSubmittedTestAndQuizz;
	}

	public String getTestAndQuizz_StudentId() {
		return testAndQuizz_StudentId;
	}

	public void setTestAndQuizz_StudentId(String testAndQuizz_StudentId) {
		this.testAndQuizz_StudentId = testAndQuizz_StudentId;
	}

	public TestAndQuizz getTestAndQuizz() {
		return testAndQuizz;
	}

	public void setTestAndQuizz(TestAndQuizz testAndQuizz) {
		this.testAndQuizz = testAndQuizz;
	}

	public User getStudent() {
		return student;
	}

	public void setStudent(User student) {
		this.student = student;
	}
}
